package com.demo2do.fms.entity.data.cost;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.demo2do.core.format.PersistentFormat;
import com.demo2do.fms.entity.authority.Organization;

/**
 * 路桥费
 * 
 * @author Wy
 *
 */
@Entity
@Table(name = "TBL_TRUCK_RB_FEE_PERKM")
@PersistentFormat
public class RoadBridgeFee {
    
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "generator")
    @SequenceGenerator(name = "generator", sequenceName = "HIBERNATE_SEQUENCE", allocationSize = 1)
    private Long id;
    
    /** 每公里的费用  */
    private BigDecimal feePerKm;
    
    /** 吨位 */
    private BigDecimal ton;
    
    /** 载重情况  -  0:重载, 1:空载  */
    @Column(name = "is_empty")
    private Boolean emp;
    
    /** 所属公司 */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "organization_Id", referencedColumnName = "id")
    @PersistentFormat
    private Organization organization;
    
    /** 开始时间  */
    private Date startDate;
    
    /** 结束时间  */
    private Date endDate;
    
    /** 创建人  */
    private Long creatorId;
    
    /** 创建时间  */
    private Date createDate;
    
    @Column(name = "is_disabled")
    private Boolean disabled;
    
    /**
     * 
     * the default constructor
     */
    public RoadBridgeFee(){
        
    }
    
    /**
     * 
     * @return
     */
    public RoadBridgeFee init() {
    	this.createDate = new Date();
    	this.disabled = false;
    	this.creatorId = new Long(1);
    	return this;
    }

    /**
     * 
     * @param operator
     * @return
     */
    public RoadBridgeFee operator(Long operator){
        this.creatorId = operator;
        return this;
    }
    
    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the feePerKm
     */
    public BigDecimal getFeePerKm() {
        return feePerKm;
    }

    /**
     * @return the ton
     */
    public BigDecimal getTon() {
        return ton;
    }

    /**
     * @return the emp
     */
    public Boolean getEmp() {
        return emp;
    }

    /**
     * @return the organization
     */
    public Organization getOrganization() {
        return organization;
    }

    /**
     * @return the startDate
     */
    public Date getStartDate() {
        return startDate;
    }

    /**
     * @return the endDate
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @return the creatorId
     */
    public Long getCreatorId() {
        return creatorId;
    }

    /**
     * @return the createDate
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * @return the disabled
     */
    public Boolean getDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param feePerKm the feePerKm to set
     */
    public void setFeePerKm(BigDecimal feePerKm) {
        this.feePerKm = feePerKm;
    }

    /**
     * @param ton the ton to set
     */
    public void setTon(BigDecimal ton) {
        this.ton = ton;
    }

    /**
     * @param emp the emp to set
     */
    public void setEmp(Boolean emp) {
        this.emp = emp;
    }

    /**
     * @param organization the organization to set
     */
    public void setOrganization(Organization organization) {
        this.organization = organization;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * @param endDate the endDate to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    /**
     * @param creatorId the creatorId to set
     */
    public void setCreatorId(Long creatorId) {
        this.creatorId = creatorId;
    }

    /**
     * @param createDate the createDate to set
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }
}
